package org.microblog.util;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.InputStream;

/**
 * @Description TODO
 * @Author hyl
 * @Date 2022/3/29 10:53
 **/
public class SessionFatoryUtil {
	public static SqlSessionFactory sessionFactory;

	static{
		InputStream is = null;
		try {
			is = Resources.getResourceAsStream("mybatis-config.xml");
			sessionFactory = new SqlSessionFactoryBuilder().build(is);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
